package com.codefish.codefish_blog.service;

import com.codefish.codefish_blog.entity.ArticleLikeRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author codefish
 * @since 2022-03-22
 */
public interface ArticleLikeRecordService extends IService<ArticleLikeRecord> {
    /**
     * 添加文章点赞记录
     *
     * @param articleId 点赞的文章id
     * @param likerId   点赞用户id
     */
    void addLikeRecord(long articleId, int likerId);

    /**
     * 移除文章点赞记录
     *
     * @param articleId 点赞的文章id
     * @param likerId   点赞的用户id
     */
    void removeLikeRecord(long articleId, int likerId);

    /**
     * 查询用户是否点赞了某篇文章
     *
     * @param articleId 文章id
     * @param likerId   用户id
     * @return 是否点赞
     */
    boolean isLike(long articleId, int likerId);

}
